//
// Created by Administrator on 2024/3/25.
//
#include<bits/stdc++.h>

using namespace std;

int main() {
    //freopen("test.in","r",stdin);
    int n;
    while (cin >> n) {
        vector<int> a(n);
        for (auto &e: a)cin >> e;
        vector<int> dp(n, 1);//dp[i]表示以a[i]结尾的最大单调子序列长度
        dp[0] = 1;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if (a[j] >= a[i])dp[i] = max(dp[i], dp[j] + 1);
            }
        }
        // copy(dp.begin(),dp.end(),ostream_iterator<int>(cerr," "));
        // cerr<<endl;

        cout << *max_element(dp.begin(), dp.end()) << endl;

    }

    return 0;
}